home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / c / cweb31p9d.lha / CWeb / examples / readme < prev    next >
Text File  |  1994-07-09  |  4KB  |  76 lines

  1. This directory contains several files for programs that are tutorial
  2. and/or useful.  If you are new to CWEB, read "wc.w" first; it's a
  3. typical example of CWEB applied to system programming.
  4.  
  5. The MAKEFILE.ORG in this directory is a generic way to build applications
  6. written in CWEB.  The MAKEFILE in this directory is a complete example
  7. makefile for the SAS/C compiler on the Commodore Amiga, written by
  8. Andreas Scherer.  Say, for example, "smake all" to get all the executable
  9. programs from their sources.  Say "smake docs" to get a printable listing
  10. of their documentations.
  11.  
  12. The WC program is a slight improvement over UNIX's standard word-count
  13. utility.  To use it, say "make wc" to get an executable program "wc"
  14. from wc.w.  Say "make wc.dvi" to get a printable listing of its documentation.
  15.  
  16. The TREEPRINT program, by Norman Ramsey, generates tree-structured
  17. representations of file hierarchies.  To use it, say "make treeprint"
  18. and then
  19.    find dir -type p -print | sort | treeprint
  20. (on a UNIX system), where dir is a directory with interesting subdirectories.
  21.  
  22. The files XVIEW_TYPES.W and XLIB_TYPES.W are examples of @i (include) files
  23. that can be used when writing XView programs.  They are based on the header
  24. files in OpenWindows Version 3.0.
  25.  
  26. An examples XVIEW application appears in Knuth's program OEMACS.W, which
  27. he uses for heavy emacsing.  It's not very portable, but if you have
  28. OpenWindows3 and a Sun Type-4 keyboard you may like it as much as he does.
  29. (It replaces "emacstool".)  The file OEMACS.EL goes with it.
  30.  
  31. The EXTEX and WORDTEST programs, by Don Knuth, are useful spellcheckers.
  32. After "make extex" say also "ln extex excweb"; this gives
  33. you two filter programs, extex and excweb, that remove extraneous
  34. material from TeX and CWEB source files, respectively. To use them,
  35. you can say for example
  36.    cat foo.w | excweb | spell
  37. (or replace "cat foo.w" with "wmerge foo.w bar.ch"). A similar pipeline
  38. for TeX files would be
  39.    cat foo.tex | extex | spell
  40. Even better is to replace "spell" by "wordtest /usr/local/lib/dict/words",
  41. if you have a suitable dictionary.  One such dictionary in the public domain
  42. can be found in directory ~ftp/pub/dict at labrea.stanford.edu, available
  43. via anonymous ftp.  To make your own dictionary from given ones,
  44.    cat dict1 dict2 dict3 dict4 | wordtest > words
  45. is quick and effective.  See the documentation of wordtest for more info.
  46.  
  47. A file KSPELL.EL that provides an emacs user interface to extex+excweb+wordtest
  48. also appears in this directory.  (Somebody should write ELWEB...)
  49.  
  50. All the CWEB example programs listed above are provided with change files
  51. for full ANSI-C compliance (prototypes, #include files, etc.), so they
  52. should be compilable with any decent C compiler, although they may not be
  53. operational on every machine.
  54.  
  55. The COMMONWORDS program, by Andreas Scherer, is based on the WEB program of
  56. the same name by Don Knuth.  It counts the frequencies of the most common
  57. words in a given text file.  To use it, say "make commonwords" and then
  58. "commonwords < commonwords.w".
  59.  
  60. The PRIMES program, by Andreas Scherer, is based on the WEB program of the
  61. same name by Don Knuth.  It generates the first thousand prime numbers.
  62. To use it, say "make primes" and then simply "primes".
  63.  
  64. The SAMPLE program, by Andreas Scherer, is based on the WEB program of the
  65. same name by Don Knuth.  It generates samples of random numbers.  To use
  66. it, say "make sample" and then simply "sample".  Answer the input questions
  67. with positive integers and see the results.
  68.  
  69. The MATRIX program, by Andreas Scherer, is an example for C++ programming
  70. with CWEB 3.  Also it is an example for German users; the complete source
  71. is written with umlauts and quotes as defined in `gcwebmac.tex'.  Its
  72. purpose is to invert 4x4 matrices with elements from the complex set.
  73.  
  74. The CCT program, by Andreas Scherer, copies `text files' between different
  75. systems and translates the character codes according to external tables.
  76.